<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> 购物车 </title>

<?php include VIEWS.'admin/style.html'?>

<script type="text/javascript">
<!--
function toggleClassNames() {
  var n = this.className;
  this.className = this.altClassName;
  this.altClassName = n;
}

function setupDatarows() {
  var v = document.getElementsByTagName("tr");
  for (var i = 0; i < v.length; i++) {
    if (v[i].className.indexOf("datarow") != -1) {
      v[i].onmouseover = toggleClassNames;
      v[i].onmouseout = toggleClassNames;
      v[i].altClassName = v[i].className + " hover";
    }
  }
}

window.onload = setupDatarows;
//-->
</script>

</head>

<body>

<?php include VIEWS.'admin/head.html'?>

<ul id="submenu">
	<li><a href='indents.php'>订单列表</a></li>
	<li><a href='indents.php?archive=1'>存档订单</a></li>
	<li><a href='shopcar.php' class="current">购物车</a></li>
</ul>

<div id="body">

<br /><br />

<table class="reportV2" cellpadding="5" width="98%" cellspacing="0">
<tr class="columntitle"><td width="5%" nowrap=""><a href="shopcar.php?sort=id">ID</a></td><td><a href="shopcar.php?sort=username">用户名</a></td><td width="50%" style="text-align:left"><a href="shopcar.php?sort=iname">物品名</a></td><td><a href="shopcar.php?sort=amount">数量</a></td><td><a href="shopcar.php?sort=updated">更新时间</a></td></tr>

<?php if (count($list['list'])==0):?><tr><td colspan="9" style="text-align:left">购物车表是空的<td></tr><?php endif;?>

<?php foreach($list['list'] as $item):
$userslist_i++;
?>
<tr class="<?php echo ($userslist_i % 2 ==0) ? 'even' : 'odd'?> datarow"><td><b><?php echo $item['id']?></b></td><td nowrap><?php echo $item['username'] ? $item['username'] : "<font color=#999999>".substr($item['sessionid'], 0, 6)."</font>"?></td><td style="text-align:left"><?php echo $item['iname']?></td><td><?php echo $item['amount']?></td><td><?php echo date('y-m-d H:i',$item['updated'])?></td></tr>
<?php endforeach;?>
</table>

<?php include VIEWS.'admin/pages.html'?>
<?php include VIEWS.'admin/runtime.html'?>

</div>

<script type="text/javascript">
Element.addClassName('am2', 'current');
</script>

</body>
</html>
